import {createRouter, createWebHashHistory} from 'vue-router';
import head from "../views/common/head.vue";
import home from "../views/common/home.vue";
import core from "../views/web/index.vue";
import db from "../views/db/index.vue";
import es from "../views/es/index.vue";

const routes = [
    {
        path: "/",
        redirect: "/head",
    },
    {
        path: "/head",
        component: head,
        redirect: "/head/home",
        children: [
            {
                path: "home",
                component: home
            },
            {
                path: "web",
                component: core
            },
            {
                path: "db",
                component: db
            }
        ]
    },
    {
        path: "/core",
        component: core
    },
    {
        path: "/db",
        component: db
    },
    {
        path: "/es",
        component: es
    },
    {
        path: "/:pathMatch(.*)",
        redirect: "/head",
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;